#!/usr/bin/python

sound_files = bld.glob('*.wav')
bld.new_task_gen(source=sound_files)
targets = []
objects = []
for wav in sound_files:
    outfile = wav.replace('.wav', '.snd.bin')
    o = bld.new_task_gen(features='padbin', source=wav.replace('.wav', '.raw'), target=outfile)
    tgt = outfile.replace('.bin', '.o')
    bld.objcopy(outfile, target=tgt)
    objects += [tgt]
    targets.append(outfile)
bld.new_task_gen(features='name2h', source=targets, target='sounds.h')
bld.new_task_gen(features='cc cstaticlib', target='snd',
        add_objects=objects,
        export_incdirs='.')
